package com.yiyahui.project.erp.service.impl;

import java.util.List;
import com.yiyahui.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yiyahui.project.erp.mapper.YiyaHistoryCaseMapper;
import com.yiyahui.project.erp.domain.YiyaHistoryCase;
import com.yiyahui.project.erp.service.IYiyaHistoryCaseService;

/**
 * 病历Service业务层处理
 * 
 * @author yiyahui
 * @date 2020-05-16
 */
@Service
public class YiyaHistoryCaseServiceImpl implements IYiyaHistoryCaseService 
{
    @Autowired
    private YiyaHistoryCaseMapper yiyaHistoryCaseMapper;

    /**
     * 查询病历
     * 
     * @param id 病历ID
     * @return 病历
     */
    @Override
    public YiyaHistoryCase selectYiyaHistoryCaseById(Long id)
    {
        return yiyaHistoryCaseMapper.selectYiyaHistoryCaseById(id);
    }

    /**
     * 查询病历列表
     * 
     * @param yiyaHistoryCase 病历
     * @return 病历
     */
    @Override
    public List<YiyaHistoryCase> selectYiyaHistoryCaseList(YiyaHistoryCase yiyaHistoryCase)
    {
        return yiyaHistoryCaseMapper.selectYiyaHistoryCaseList(yiyaHistoryCase);
    }

    /**
     * 新增病历
     * 
     * @param yiyaHistoryCase 病历
     * @return 结果
     */
    @Override
    public int insertYiyaHistoryCase(YiyaHistoryCase yiyaHistoryCase)
    {
        yiyaHistoryCase.setCreateTime(DateUtils.getNowDate());
        return yiyaHistoryCaseMapper.insertYiyaHistoryCase(yiyaHistoryCase);
    }

    /**
     * 修改病历
     * 
     * @param yiyaHistoryCase 病历
     * @return 结果
     */
    @Override
    public int updateYiyaHistoryCase(YiyaHistoryCase yiyaHistoryCase)
    {
        yiyaHistoryCase.setUpdateTime(DateUtils.getNowDate());
        return yiyaHistoryCaseMapper.updateYiyaHistoryCase(yiyaHistoryCase);
    }

    /**
     * 批量删除病历
     * 
     * @param ids 需要删除的病历ID
     * @return 结果
     */
    @Override
    public int deleteYiyaHistoryCaseByIds(Long[] ids)
    {
        return yiyaHistoryCaseMapper.deleteYiyaHistoryCaseByIds(ids);
    }

    /**
     * 删除病历信息
     * 
     * @param id 病历ID
     * @return 结果
     */
    @Override
    public int deleteYiyaHistoryCaseById(Long id)
    {
        return yiyaHistoryCaseMapper.deleteYiyaHistoryCaseById(id);
    }
}
